Skip to main content

IValidator<T>

Defines a validator for a particular type.

Assembly: ServiceStack.dll
View Source
Declaration
public interface IValidator<in T> : IValidator

Properties

CascadeMode

Sets the cascade mode for all rules within this validator.

View Source
Declaration
CascadeMode CascadeMode { get; set; }

Methods

Validate(T)

Validates the specified instance.

View Source
Declaration
ValidationResult Validate(T instance)
Returns

ServiceStack.FluentValidation.Results.ValidationResult: A ValidationResult object containing any validation failures.

Parameters
TypeNameDescription
<T>instanceThe instance to validate

|

ValidateAsync(T, CancellationToken)

Validate the specified instance asynchronously

View Source
Declaration
Task<ValidationResult> ValidateAsync(T instance, CancellationToken cancellation = default(CancellationToken))
Returns

System.Threading.Tasks.Task<ServiceStack.FluentValidation.Results.ValidationResult>: A ValidationResult object containing any validation failures.

Parameters
TypeNameDescription
<T>instanceThe instance to validate

| | System.Threading.CancellationToken | cancellation |

|